package wyd;

import java.io.File
import java.io.InputStream
import java.io.OutputStream
import java.io.BufferedOutputStream

public class WydFileCategory {

	def static leftShift(File inFile, File outFile) {
		def input = null
		def output = null

		try {
			input = inFile.openStream()
			output = new BufferedOutputStream(new FileOutputStream(outFile))
			output << input
		}
		finally {
			input?.close()
			output?.close()
		}
	}

	def static leftShift(InputStream inStream, OutputStream outStream) {
		def input = null
		def output = null

		try {
			input = inStream
			output = new BufferedOutputStream(outStream)
			output << input
		}
		finally {
			input?.close()
			output?.close()
		}
	}

	def static leftShift(File inFile, OutputStream outStream) {
		def input = null
		def output = null

		try {
			input = inFile.openStream()
			output = new BufferedOutputStream(outStream)
			output << input
		}
		finally {
			input?.close()
			output?.close()
		}
	}
}